<template>
  <div>
    <h1 ref="domH1">App</h1>
    <div ref="domDiv">DIV</div>
    <TsLoad ref="comTsLoad" v-if="flag"></TsLoad>

    <button @click="say">say</button>
  </div>
</template>
<script>
export default {
  data() {
    return {
      flag: true,
    }
  },
  methods: {
    say() {
      this.flag = false;
      // console.log(this.$refs.domH1);
      // console.log(this.$refs.domDiv);
      // 相当于组件内部的this
      console.log(this.$refs.comTsLoad);
      console.log(this.$refs.comTsLoad.title);
      this.$refs.comTsLoad.title = 'hahaha';
      this.$refs.comTsLoad.log('hello load');
    }
  }
}
</script>
<style>
div {
  border: solid;
  padding: 10px;
}
</style>